FROM  dxlani/node12_cnpm  as  builder

WORKDIR  /app

COPY  ./package.json  /app/

RUN  cnpm  install  --allow-root

COPY  .  /app/

RUN  cnpm  run  build

FROM  nginx:1.15.12

COPY  ./conf/nginx.conf  /etc/nginx/nginx.conf
COPY  ./conf/default.conf  /etc/nginx/conf.d/default.conf

COPY  --from=builder  /app/dist  /usr/share/nginx/html

ENV  TZ=Asia/Shanghai
RUN  ln  -snf  /usr/share/zoneinfo/$TZ  /etc/localtime  &&  echo  $TZ  >  /etc/timezoness

EXPOSE  80

CMD  ["nginx",  "-g",  "daemon  off;"]